import 'package:dart_bean/field_info.dart';
import 'package:dart_bean/generator.dart';
import 'package:dart_bean/util/error_tip.dart';
import 'package:dart_bean/util/field_feature.dart';

class UnsupportedMapGenericChecker extends FieldFeature {
  static final it = UnsupportedMapGenericChecker._();

  UnsupportedMapGenericChecker._();

  @override
  String? getConvert(FieldInfo field) {
    if (field.type.startsWith('Map<')) {
      onError('$unsupportedMapFieldError\n${fieldErrorInfo(field)}');
    }
    return null;
  }
}
